package com.elt.http.factory.impl;

import com.elt.config.XmlConfig;
import com.elt.http.async.base.BaseAsyncExcute;
import com.elt.http.async.callback.base.BaseHandler;
import com.elt.http.factory.inter.IHttpFactory;
import com.elt.http.model.GetModel;
import com.elt.http.model.LoadImgModel;
import com.elt.http.model.PostModel;
import com.elt.http.sync.inter.IHttpRequest;

public class HttpFactory implements IHttpFactory {

	@Override
	public BaseAsyncExcute<GetModel> create(GetModel t,
			BaseHandler<GetModel> handler) {
		// TODO Auto-generated method stub
		BaseAsyncExcute<GetModel> bae = XmlConfig.getValue("AsyncGetExcute");
		bae.setMoedelHandler(t, handler);
		return bae;
	}

	@Override
	public BaseAsyncExcute<PostModel> create(PostModel t,
			BaseHandler<PostModel> handler) {
		// TODO Auto-generated method stub
		// return new AsyncPostExcute(t, handler);
		BaseAsyncExcute<PostModel> bae = XmlConfig.getValue("AsyncPostExcute");
		bae.setMoedelHandler(t, handler);
		return bae;
	}

	@Override
	public BaseAsyncExcute<LoadImgModel> create(LoadImgModel t,
			BaseHandler<LoadImgModel> handler) {
		// TODO Auto-generated method stub
		// return new AsyncLoadImgExcute(t, handler);
		BaseAsyncExcute<LoadImgModel> bae = XmlConfig
				.getValue("AsyncLoadImgExcute");
		bae.setMoedelHandler(t, handler);
		return bae;
	}

	@Override
	public IHttpRequest create() {
		// TODO Auto-generated method stub
		return XmlConfig.getValue("HttpImpl");
	}

}
